#include <iostream>
#include <cmath>
#include "TamGiac.h"

using namespace std;

TamGiac::TamGiac( unsigned a, unsigned b, unsigned c){
    canh1 = a;
    canh2 = b;
    canh3 = c;
}
bool  TamGiac::kt_tam_giac(){
    if (    canh1 + canh2 <= canh3
        ||  canh1 + canh3 <= canh2
        ||  canh2 + canh3 <= canh1) return false;
    return true;
}
float TamGiac::dien_tich(){
    if (this->kt_tam_giac() == true){
        float t = ( canh1 + canh2 + canh3) / 2;
        return sqrt( t * ( t - canh1) * ( t - canh2) * ( t - canh3));
    }
	return 0;
}
float TamGiac::chu_vi(){
    if ( this->kt_tam_giac() == true){
        return canh1 + canh2 + canh3;
    }
	return 0;
}